package com.teemo.dp.singleton.demo9;

import java.lang.reflect.Constructor;

/**
 * @author Teemo
 */
public class Demo {
    public static void main(String[] args)throws Exception {
        Washer washer = Washer.getInstance();
        Washer washer1 = Washer.getInstance();
        System.out.println(washer);
        System.out.println(washer1);

        Constructor<Washer> declaredConstructor = Washer.class.getDeclaredConstructor();
        declaredConstructor.setAccessible(true);
        Washer washer2 = declaredConstructor.newInstance();
        washer2.wash();
        System.out.println(washer2);
    }
}
